/**
 * Created by djklaf on 2017/3/21.
 */
import Vue from 'vue'
import Message from 'vue-bulma-message'

const MessageComponent = Vue.extend(Message)
const openMessage = (propsData = {
  title: '',
  message: '',
  type: '',
  direction: '',
  duration: 2000,
  container: '.messages'
}) => {
  return new MessageComponent({
    el: document.createElement('div'),
    propsData
  })
}

function openMessageWithType (type, title, message) {
  console.log(message)
  openMessage({
    title: title,
    message: message,
    type: type
  })
}

export default openMessageWithType
